<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工单详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!--1.width=device-width    //应用程序的宽度和屏幕的宽度是一样的
2.height=device-height  //应用程序的高度和屏幕的高是一样的
3.initial-scale=1.0  //应用程序启动时候的缩放尺度（1.0表示不缩放）
4.minimum-scale=1.0  //用户可以缩放到的最小尺度（1.0表示不缩放）
5.maximum-scale=1.0  //用户可以放大到的最大尺度（1.0表示不缩放）
6.user-scalable=no  //用户是否可以通过他的手势来缩放整个应用程序，使应用程序的尺度发生一个改变（yes/no）
    -->
    <!-- 优先使用 IE 最新版本和 Chrome -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="{{asset('4s/font-awesome-4.7.0/css/font-awesome.css')}}">
    <link rel="stylesheet" href="{{asset('4s/style/weui.min.css')}}"/>
    <link rel="stylesheet" href="{{asset('4s/style/style.css')}}"/>
    <link rel="stylesheet" href="{{asset('4s/js/raty/lib/jquery.raty.css')}}">
</head>
<body style="background: #f5f5f5">
<!--头部-->
<!-- <div class="search-box">
    <button class="btn fa fa-angle-left back-icon"></button>
    <span>咨询详情</span>
</div>  -->
<!--end 头部-->
<div class="banner"><img src="https://zixun.c-make.net/zhuanjia/images/topbanner.png" alt=""></div>
<!--主体-->
<div class="detail-box">

    <!--咨询-->
    <h4 class="item-title">工单内容</h4>
    <div class="detail-white-box">
        <h4 class="detail-box-title">单号：{{$data->code}}</h4>
        <h5 class="detail-box-title">时间：{{$data->created_at}}</h5>
        <h5 class="detail-box-title">车牌号：{{$data->car_num?$data->car_num:$data->car->car_num}}</h5>
        <div class="detail-box-text">            
            <p>送修人：{{$data->name}}</p>
            <p>送修人电话：{{$data->phone}}</p>           
            <p>送修日期：{{$data->arrived_at}}</p>
            <p>送修里程：{{$data->miles}}公里</p>
            <p>维修类型：{{object_get($data,'maintian.name')}}</p>
            <p>故障信息：{{$data->bug_info}}</p>
        </div>
        <h4>维修负责人：{{object_get($data,'worker.truename')}}</h4>
       
       
        <!--end 上传的图片-->
    </div>
    <!--咨询-->
    <div class="QA-white-box">
        <div class="weui-cells__title title-ask">客户评价</div>
    @foreach($comments as $comment)
    
            <div class="reply-text">
                <p>得分：
                    <div id="score"></div>
                </p>
                <p>
                     {{$comment->msg}}
                </p>
                   
                
            </div>
           
            @endforeach
    </div> 
    </div>        
    
 

    @if($data->status==100)
    <!-- 评价工单-->
    <div class="ask-box">
        <form action="{{url('user/task/comment-save')}}?task_id={{$data->id}}" method="post">
        <div class="weui-cells__title title-ask">评价内容</div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <div id="point"></div>
                    
                </div>
            </div>        
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <textarea class="weui-textarea" placeholder="请输入评价信息..." rows="5" name="msg"></textarea>
                </div>
            </div>
        </div>
        
        
        
        <div class="ask-btn-box">
            <button type="submit" class="weui-btn weui-btn_mini weui-btn_primary">评价</button>
        </div>

        

{{csrf_field()}}
        </form>
    </div>
    @endif

    <!-- end继续回复-->
</div>
<!--主体-->
<!--js-->
<script src="{{asset('4s/js/jquery-2.2.3.min.js')}}"></script>
<script src="{{asset('4s/js/raty/lib/jquery.raty.js')}}"></script>
<script type="text/javascript">
    $('#point').raty({
        path: '{{asset("4s/js/raty/lib/images")}}'
        
    });

    $('#score').raty({
        path: '{{asset("4s/js/raty/lib/images")}}',
        readOnly: true, 
        score: '{{$comment->score}}' 
        
    });
</script>
</body>
</html>